package io.github.yotta.export.web.simple;

import io.github.yotta.common.api.model.Paging;
import io.github.yotta.export.core.model.ExecuteContext;
import io.github.yotta.export.web.iface.SpringExcelDataExporter;
import org.springframework.stereotype.Component;

/**
 * @author yotta
 * @date 2023/10/31 18:16
 */
@Component
public class UserExporter implements SpringExcelDataExporter<UserExportModel, UserExportParam> {

    private final UserService userService;

    public UserExporter(UserService userService) {
        this.userService = userService;
    }

    @Override
    public Paging<UserExportModel> exportData(UserExportParam exportParam, ExecuteContext context) {
        return userService.page(exportParam);
    }

    @Override
    public String exportFileName(UserExportParam exportParam, ExecuteContext context) {
        return "用户数据导出接口实现";
    }
}
